import 'package:kkhousekeep/generated/json/base/json_field.dart';
import 'package:kkhousekeep/generated/json/home_village_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class HomeVillageEntity {
	late int code;
	late List<HomeVillageObj> obj;
	late String msg;

	HomeVillageEntity();

	factory HomeVillageEntity.fromJson(Map<String, dynamic> json) => $HomeVillageEntityFromJson(json);

	Map<String, dynamic> toJson() => $HomeVillageEntityToJson(this);

	HomeVillageEntity copyWith({int? code, List<HomeVillageObj>? obj, String? msg}) {
		return HomeVillageEntity()
			..code= code ?? this.code
			..obj= obj ?? this.obj
			..msg= msg ?? this.msg;
	}

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class HomeVillageObj {
	late int id;
	late String name;

	HomeVillageObj();

	factory HomeVillageObj.fromJson(Map<String, dynamic> json) => $HomeVillageObjFromJson(json);

	Map<String, dynamic> toJson() => $HomeVillageObjToJson(this);

	HomeVillageObj copyWith({int? id, String? name}) {
		return HomeVillageObj()
			..id= id ?? this.id
			..name= name ?? this.name;
	}

	@override
	String toString() {
		return jsonEncode(this);
	}
}